﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PowershellHostRawUI.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Implementation of PSHostRawUserInterface.
//   Only the BackgroundColor and ForegroundColor properties are implemented, the rest
//   are not needed and don't make much sense from SAF.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Powershell
{
    using System;
    using System.Management.Automation.Host;

    /// <summary>
    /// Implementation of PSHostRawUserInterface.
    /// Only the BackgroundColor and ForegroundColor properties are implemented, the rest
    /// are not needed and don't make much sense from SAF.
    /// </summary>
    public class PowershellHostRawUI : PSHostRawUserInterface
    {
        public override ConsoleColor BackgroundColor
        {
            get
            {
                return ConsoleColor.Black;
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override Size BufferSize
        {
            get
            {
                return new Size(100, 400);
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override Coordinates CursorPosition
        {
            get
            {
                return new Coordinates(1, 1);
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override int CursorSize
        {
            get
            {
                return 15;
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override void FlushInputBuffer()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override ConsoleColor ForegroundColor
        {
            get
            {
                return ConsoleColor.White;
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override BufferCell[,] GetBufferContents(Rectangle rectangle)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override bool KeyAvailable
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override Size MaxPhysicalWindowSize
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override Size MaxWindowSize
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override KeyInfo ReadKey(ReadKeyOptions options)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override Coordinates WindowPosition
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override Size WindowSize
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        public override string WindowTitle
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }

            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }
    }
}